import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Lenovo
 * @Date: 2024/6/10 9:51
 * @description:
 */
public class Test {
    public static void main(String[] args) {
        CardDemo cardDemo=new CardDemo();
        List<Card>cards=cardDemo.buyCard();
        cardDemo.shuttle(cards);
        System.out.println(cards);
        List<List<Card>>hand=cardDemo.play(cards);
        System.out.println("A中的牌");
        System.out.println(hand.get(0));
        System.out.println("B中的牌");
        System.out.println(hand.get(1));
        System.out.println("C中的牌");
        System.out.println(hand.get(2));
    }
    public List<List<Integer>> generate(int numRows) {
        List<List<Integer>>list=new ArrayList<>();
        //先把第一行填满
        List<Integer>list0=new ArrayList<>();
        list0.add(1);
        list.add(list0);
        //再把剩余的填满
        for (int i=1;i<numRows;i++){
            List<Integer>curRow=new ArrayList<>();
            //第一个
            curRow.add(1);
            //中间
            List<Integer>preRow=list.get(i-1);
            for (int j = 1; j < i; j++) {
                int val1=preRow.get(j);
                int val2=preRow.get(j-1);
                curRow.add(val2+val1);
            }
            //最后一个
            curRow.add(1);
            list.add(curRow);
        }
        return list;
    }
    public static void main1(String[] args) {
       ArrayList<Integer>list=new ArrayList<>();
       //add尾插
       list.add(1);
       list.add(2);
       list.add(3);
       //在指定位置插入
       list.add(2,4);
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i)+" ");
        }
        System.out.println();
       //subList
        List<Integer>list1=new ArrayList<>();
        list1=list.subList(2,4);
        for (int i=0;i<list1.size();i++){
            System.out.print(list1.get(i)+" ");
        }
        System.out.println();
        list.set(2,99);
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i)+" ");
        }
        System.out.println();
        for (int i=0;i<list1.size();i++){
            System.out.print(list1.get(i)+" ");
        }
    }
}
